//package cn.pa4j.hotreload;
//
//import cn.hutool.core.convert.impl.ArrayConverter;
//import cn.hutool.core.io.FileUtil;
//
//import java.io.File;
//import java.io.InputStream;
//import java.lang.reflect.Method;
//import java.net.URL;
//import java.net.URLClassLoader;
//import java.util.Enumeration;
//import java.util.List;
//import java.util.jar.JarEntry;
//import java.util.jar.JarFile;
//
///**
// * Created by 060016 on 2017-11-29.
// */
//public class Demo {
//    public static void main(String[] args) throws Exception {
////
////        List<File> files = FileUtil.loopFiles("C:\\Users\\060016.CNMGTJ\\Desktop", pathname -> pathname.getName().endsWith(".jar") ? true : false);
////
////        URL[] urls = (URL[]) new ArrayConverter(URL.class).convert(files, null);
//////        URL url = urls[1];
//////        System.out.println(url);
////////        InputStream is = url.openStream();
//////        byte b[] = new byte[1000];
////
//////        System.out.println(is.toString());
////        JarFile jarFile = new JarFile(files.get(2));
////        Enumeration<JarEntry> entries = jarFile.entries();
////        URLClassLoader myClassLoader = new URLClassLoader(urls, Thread.currentThread()
////                .getContextClassLoader());
////        while (entries.hasMoreElements()) {
////            JarEntry entry = entries.nextElement();
////            String name = entry.getName();
////            if (name.contains("CMSService")) {
////                System.out.println(name);
////                Class<?> myClass = myClassLoader.loadClass(name.replace(".class", "").replace("/","."));
////                Method[] methods = myClass.getMethods();
////                for (Method method : methods) {
////                    System.out.println(method.getName());
////                    int parameterCount = method.getParameterCount();
////                    System.out.println(parameterCount);
////                    Class<?>[] parameterTypes = method.getParameterTypes();
////                    for (Class<?> parameterType : parameterTypes) {
////                        System.out.println(parameterType.getName());
////                    }
////                }
////            }
////        }
//        File root = FileUtil.file("upload");
//        List<File> files = FileUtil.loopFiles(root);
//        URL[] urls = (URL[]) new ArrayConverter(URL[].class).convert(files, null);
//        URLClassLoader myClassLoader = new URLClassLoader(urls, Thread.currentThread()
//                .getContextClassLoader());
//        Class<?> myClass = myClassLoader.loadClass("cn.loyle.AppService");
//        Method[] methods = myClass.getMethods();
//        for (Method method : methods) {
//            System.out.println(method.getName());
//        }
////        Method queryStock = myClass.getMethod("queryStock");
////        queryStock.invoke(myClass.newInstance());
////        System.out.println(myClass);
//    }
//
//}
